<template>
<div>
	<ul class="mui-table-view">
		<li class="mui-table-view-cell mui-media" v-for='item in newsList' :key='item.id'>
			<router-link :to="'/home/newsInfo?id=' + item.id">
				<img class="mui-media-object mui-pull-left" v-bind:src='item.img_url'>
				<div class="mui-media-body">
					<h3>{{item.title}}</h3>
					<p class='mui-ellipsis'>
						<span>{{item.add_time | dateFormat}}</span>
						<span>点击{{item.click}}次</span>
					</p>
				</div>
			</router-link>
		</li>
	</ul>
</div>
</template>
<script type="text/javascript">
	import 'vue-resource';
	export default{
		data() {
			return {
				newsList: null
			}
		},
		created() {
			this.$http.get('newsList')
			.then(function (res) {
				this.newsList = JSON.parse(res.body.resBody.data);
				console.log(this.newsList[0].img_url)
			})
		}
	}
</script>
<style lang="less" scoped>
	.mui-table-view{
		li{
			h3{font-size: 14px;}
			.mui-ellipsis{
				font-size: 12px;
				color: skyblue;
				display: flex;
				justify-content: space-between;
			}
		}
	}
</style>